{
======================================================================
Project  : Firebird Control Center
Unit     : FB_Consts.pas
Purpose  : Firebird related constants
Author   : Achim Kalwa <delphi@achim-kalwa.de>
Compiler : Borland Delphi 5.01
----------------------------------------------------------------------
History:
2002-03-16, Kalwa:
- Unit created

2002-10-17, Kalwa:
- now supports both Firebird 1.0 and 1.5

2002-11-20, Kalwa:
- changed version no to 0.0.6

2002-11-21, Kalwa:
- new const "IB_RegKey" for accessing Borland/InterBase reg entries

2003-01-20, Kalwa:
- Changed Firebird 1.5 Server service name from "InterBaseServer" to
  "FirebirdServer" as stated by dimitr@users.sourceforge.net
- Changed version no. to 0.0.8.

2003-01-30, Kalwa, V0.0.9:
- Firebird 1.5 Beta 1:
  Changed IB_Server/IB_Guard to FB_Server/FB_Guard
  (Thanks to Lucarz Philippe)

2003-02-14, Kalwa, V0.1.1:
- Firebird 1.5 Beta 2

2003-03-24, V0.1.2: Kalwa:
- Firebird 1.5 Beta 4

2003-03-24, V0.1.3: Kalwa:
- Firebird 1.5 Beta 4

2003-03-24, V0.1.4: Kalwa:
- Fixed some problems in RegisterServer/InstallServer with pathnames
  containing blanks.

2003-04-26, V0.1.5, Kalwa:
- Changed "Firebird" to "FirebirdSQL", since that is the correct name.

2003-05-02, V0.1.6, Kalwa:
- See fMain.pas for changes.

2003-05-12, V0.2.0, Kalwa:
- See fMain.pas for changes.

2003-06-05, V0.2.1, Kalwa:
- See fMain.pas for changes.

2003-06-12, V0.2.2, Kalwa:
- See fMain.pas for changes.
======================================================================
}
{$I fbcc.inc}
unit FB_Consts;

interface

const
  { common strings }
  IB_RegKey          = '\Software\Borland\InterBase\CurrentVersion';
  IB_GuardianOptions = 'GuardianOptions';
  IB_RootDir         = 'RootDirectory';
  IB_Version         = 'Version';

  FB_RegKey          = '\Software\Firebird Project\Firebird Server\Instances';
  FB_DefaultInstance = 'DefaultInstance';
  FB_Version         = 'Version';
  
  FB_AutoStartName   = 'Firebird';
  FB_AutoRunKey      = '\Software\Microsoft\Windows\CurrentVersion\Run';
  FB_ServicesKey     = '\SYSTEM\CurrentControlSet\Services\';

type
  TServerType        = (stNone, stFirebird1, stFirebird15);
  TFirebirdName      = (ServerExe, GuardExe, ServerClass, GuardClass, ServerName, GuardianName);
  TFirebirdNames     = Array[TFirebirdName] of String;

const
  Firebird1Names : TFirebirdNames = ('ibserver.exe','ibguard.exe', 'IB_Server', 'IB_Guard', 'InterBaseServer', 'InterBaseGuardian');
  Firebird15Names: TFirebirdNames = ('fbserver.exe','fbguard.exe', 'FB_Server', 'FB_Guard', 'FirebirdServerDefaultInstance', 'FirebirdGuardianDefaultInstance');

procedure SetServerType(Value : TServerType);
function GetServerType : TServerType;
function GetName(ndx : TFirebirdName) : String;

implementation

var
  FServerType : TServerType;

function GetServerType : TServerType;
begin
  Result := FServerType;
end;

procedure SetServerType(Value : TServerType);
begin
  FServerType := Value;
end;

function GetName(ndx : TFirebirdName) : String;
begin
  case FServerType of
    stNone:
      Result := '';
    stFirebird1:
      Result := Firebird1Names[ndx];
    stFirebird15:
      Result := Firebird15Names[ndx];
  end;
end; { GetName }

Initialization
  FServerType := stNone;
end.
